/**
 * Created by Henry on 15/6/13.
 */
Ext.define('Ext.ux.Transparent', {
    extend: 'Ext.button.Button',
    xtype: 'btntransparent',

    initComponent: function () {
        this.listeners = {
            mouseout: function () {
                return this.setTransparent(document.getElementById(this.id));
            },
            mouseover: function () {
                return this.removeTransparent(document.getElementById(this.id));
            },
            afterrender: function () {
                return this.setTransparent(document.getElementById(this.id));
            }
        };
        return this.callParent();
    },

    setTransparent: function (e) {
        e.style.backgroundImage = 'inherit';
        e.style.backgroundColor = 'inherit';
        return e.style.borderColor = 'transparent';
    },

    removeTransparent: function (e) {
        e.style.backgroundImage = '';
        e.style.backgroundColor = '';
        return e.style.borderColor = '';
    }
});